package exser;

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.stream.Stream;

/**
 * @author: knowno
 * @create: 2025-09-17 10:45
 * @Version 1.0
 **/
public class TestDerSerializable {
    public static void main(String[] args) {

        try {
            //1 ObjectInputStream对象创建
            ObjectInputStream ois = new ObjectInputStream(new FileInputStream("user.txt"));
           //2 调用readObject方法实现反序列化操作
            User obj = (User) ois.readObject();
            System.out.println(obj);
            //3 释放资源
            ois.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }

    }
}
